<template>
  <div>
    <h1>aaaa</h1>
    <router-link to="/a/aa?id=100&name=zhangsan">连接到aa页面</router-link>
    <Button @click="toAA">按钮跳转到AA页面</Button>
    <input type="text" v-model="iname">
    <router-view></router-view>
  </div>
</template>

<script>
//导出单文件组件
export default {
  name: "a1",
  data() {
    return {
      iname:'默认值'
    }
  },
  methods: {
    toAA() {
      this.$router.push({
        path: "/a/aa",
        query: {
          id: 200,
          name: this.iname,
        },
      },()=>{});
    },
  },
};
</script>

<style>
h1 {
  color: rgb(242, 0, 255);
}
</style>